package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-07-23 10:38
 */
public class Cat extends Animal{

    private int health;

    public Cat() {
    }
    public Cat(String name, int age,int health) {
        super(name, age);
        this.health = health;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public String toString(){
//        return "name:"+getName()+".....";
        return super.toString()+" health:"+health;
    }

    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }

    public void playBall(){
        System.out.println("cat play ball");
    }
}
